package org.example.aop;

import org.example.aop.service.Userservice;
import org.junit.Before;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class SpringAoptest {
    private ApplicationContext context;
    @Before
    public void setUp() throws Exception {
        context = new ClassPathXmlApplicationContext("test_aop_config.xml");
    }

    @Test
    public void test() {
        Userservice userservice = (Userservice) context.getBean("userservice");
        //userservice.add();
        System.out.println("del()方法的返回值"+userservice.del(20));
    }

}
